]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
overviewControls: Clarify some code with a comment
authorJasper St. Pierre <jstpierre@mecheye.net>
Wed, 18 Sep 2013 23:48:22 +0000 (19:48 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Sat, 12 Oct 2013 18:38:13 +0000 (14:38 -0400)
translationX is sort of a bad name, since it confuses with the
actor's translation, which is used for sliding without allocation.

https://bugzilla.gnome.org/show_bug.cgi?id=694881

js/ui/overviewControls.js

index 4128d6ce603bbc6e294bcc40ef99514717a88b09..a415cc1b0e0c2cb0cb7a4fa0f771951ae54973b9 100644 (file)
@@ -59,12 +59,14 @@ const SlideLayout = new Lang.Class({
         let availWidth = Math.round(box.x2 - box.x1);
         let availHeight = Math.round(box.y2 - box.y1);
 
+        // Align the actor inside the clipped box, as the actor's alignment
+        // flags only determine what to do if the allocated box is bigger
+        // than the actor's box.
         let realDirection = getRtlSlideDirection(this._direction, child);
-        let translationX = (realDirection == SlideDirection.LEFT) ?
-            (availWidth - natWidth) : (natWidth - availWidth);
+        let alignX = (realDirection == SlideDirection.LEFT) ? (availWidth - natWidth) : (natWidth - availWidth);
 
         let actorBox = new Clutter.ActorBox();
-        actorBox.x1 = translationX;
+        actorBox.x1 = alignX;
         actorBox.x2 = actorBox.x1 + child.x_expand ? availWidth : natWidth;
         actorBox.y1 = 0;
         actorBox.y2 = actorBox.y1 + child.y_expand ? availHeight : natHeight;